import qs from 'qs'
import http from '../utils/http/request'

//获取 Code 后进行登录
export const codeLogin = (params) => {
    return http.get('/v1/auth/codeLogin?code=' + params)
}


//请求首页数据
// export const getLogin = (params) => {
//     //返回一个promise对象
//     return http.get('/v1/auth/codeLogin')
// }

//获取任务数据
export const getTask = (params) => {
    return http.get('/task/select', params)
}
export const addTask = (data) => {
    return http.post('/task/saveTask', data)
}

export const editTask = (data) => {
    return http.post('/task/update', data)

}

export const delTask = (params) => {
    return http.get('/task/delete?id=' + params)
}

//获取群组数据(新增任务)
export const getGroup = (params) => {
    return http.get('/group/selectGroup', params)
}

//获取群组数据(新增群组)
export const getListGroup = (params) => {
    return http.get('/group/personListNewNew', params)
}


export const addGroup = (data) => {
    return http.post('/group/saveGroup', data)
}


export const editGroup = (data) => {
    return http.post('/group/updateGroup', data)

}

export const delGroup = (params) => {
    return http.get('/group/removeGroup?id=' + params)
}

// 任务详情查看
export const taskDetail = (params) => {
    return http.get('/task/details?id=' + params)
}

//确定任务状态
export const submitDet = (params) => {
    return http.get('/executor/state/1?taskId=' + params)
}

//获取级联数据
export const getCascade = () => {
    return http.get('/group/personListAndGroup')
}
//图片上传接口
export const fileUpload = (data) => {
    return http.post('/task/uploadImage',data)
}

// //录音上传接口
// export const fileUpload = (data) => {
//     return http.post('/task/uploadFile',data)
// }